Skip to content

Tighten error matching, improve login context handling, and tests#281

Merged
leggetter merged 3 commits intofix/mcp-not-logged-in-errorfrom
claude/review-pr-280-my8PD
Apr 1, 2026
Merged

Tighten error matching, improve login context handling, and tests#281
leggetter merged 3 commits intofix/mcp-not-logged-in-errorfrom
claude/review-pr-280-my8PD

Conversation

@leggetter
Copy link
Copy Markdown
Collaborator

No description provided.

claude added 3 commits April 1, 2026 11:28
- tool_projects_errors.go: match "status code: 4xx" instead of bare
  "401"/"403" to avoid false positives on IDs or timestamps
- tool_login.go: remove `_ = ctx` suppression, add TODO for context
  propagation to polling goroutine, document happens-before on
  loginState.err via channel close
- root.go: add maintenance comment linking flagNeedsNextArg to init()
- helpers.go: revert unrelated Attempt struct alignment change

https://claude.ai/code/session_01EpXZqTmgybtjgmSALukH8d
- projects.go: use checkAndPrintError instead of manual status check so
  ListProjects errors are structured *APIError — the errors.As path in
  shouldSuggestReauthAfterListProjectsFailure now matches directly
- tool_projects_errors_test.go: unit tests for reauth hint logic covering
  APIError 401/403, plain error fallback, and false-positive resistance
- root_argv_test.go: document boolean-flag-between-subcommands limitation

https://claude.ai/code/session_01EpXZqTmgybtjgmSALukH8d
Thread the request context into the login polling goroutine so it
stops promptly when the MCP transport closes, instead of running for
up to ~4 minutes after the client disconnects.

WaitForAPIKey blocks with time.Sleep and doesn't accept a context, so
we run it in an inner goroutine and select on both its result channel
and ctx.Done(). The inner goroutine is bounded by loginMaxAttempts.

https://claude.ai/code/session_01EpXZqTmgybtjgmSALukH8d
@leggetter leggetter merged commit cb8e598 into fix/mcp-not-logged-in-error Apr 1, 2026
1 check passed
@leggetter leggetter deleted the claude/review-pr-280-my8PD branch April 1, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants